package edu.ruc.cluster.print;

import java.io.IOException;  
import java.io.PipedReader;  
import java.io.PipedWriter;  
import java.io.Writer;
import org.apache.log4j.Logger;
import org.apache.log4j.Appender;  
import org.apache.log4j.WriterAppender; 

public abstract class LogAppender extends Thread{

	protected PipedReader reader;
	
	public LogAppender(String appenderName) throws IOException{
		Logger root = Logger.getRootLogger();
		Appender appender = root.getAppender(appenderName);
		reader = new PipedReader();
		Writer writer = new PipedWriter(reader);
		((WriterAppender)appender).setWriter(writer);
	}
}
